home *** CD-ROM | disk | FTP | other *** search
/ Resource Library: Multimedia / Resource Library: Multimedia.iso / hypercrd / xcmds / shwdlg16.hqx / ShowDialog XCMD 1.6 / card_3019.txt < prev    next >
Text File  |  1989-05-10  |  8KB  |  233 lines

  1. -- card: 3019 from stack: in.6
  2. -- bmap block id: 5095
  3. -- flags: 0000
  4. -- background id: 3411
  5. -- name: What is ShowDialog
  6. ----- HyperTalk script -----
  7. on turnOn buttonNo
  8.   lock screen
  9.   repeat with counter = 1 to 4
  10.     if buttonNo = counter then
  11.       set the hilite of cd btn counter to TRUE
  12.       show bg fld counter
  13.     else
  14.       set the hilite of cd btn counter to FALSE
  15.       hide bg fld counter
  16.     end if
  17.   end repeat
  18.   set scroll of bg fld buttonNo to 0
  19.   show bg btn "Close Information"
  20.   unlock screen with visual effect dissolve
  21. end turnOn
  22.  
  23. on closeall
  24.   set cursor to watch
  25.   lock screen
  26.   repeat with x = 1 to 4
  27.     hide bg fld x
  28.     set hilite of cd btn x to FALSE
  29.   end repeat
  30.   hide bg btn "Close Information"
  31.   unlock screen with visual effect dissolve
  32. end closeall
  33.  
  34. on closecard
  35.   closeall
  36. end closecard
  37.  
  38. on printIt
  39.   put bg fld 1 & return & bg fld 2 & return & bg fld 3 & return & bg fld 4 into container
  40.   put bg fld "Title" into prompt
  41.   PrintDoc prompt,container,prompt,times,12
  42. end printIt
  43.  
  44.  
  45.  
  46. -- part 1 (button)
  47. -- low flags: 00
  48. -- high flags: A004
  49. -- rect: left=17 top=90 right=112 bottom=194
  50. -- title width / last selected line: 0
  51. -- icon id / first selected line: 0 / 0
  52. -- text alignment: 1
  53. -- font id: 0
  54. -- text size: 12
  55. -- style flags: 0
  56. -- line height: 16
  57. -- part name: What is ShowDialog?
  58. ----- HyperTalk script -----
  59. on mouseUp
  60.   if the visible of bg fld (the number of me) then
  61.     closeall
  62.   else
  63.     put the number of me into displayinfo
  64.     turnOn displayinfo
  65.   end if
  66. end mouseUp
  67.  
  68.  
  69.  
  70. -- part 2 (button)
  71. -- low flags: 00
  72. -- high flags: A004
  73. -- rect: left=17 top=120 right=142 bottom=194
  74. -- title width / last selected line: 0
  75. -- icon id / first selected line: 0 / 0
  76. -- text alignment: 1
  77. -- font id: 0
  78. -- text size: 12
  79. -- style flags: 0
  80. -- line height: 16
  81. -- part name: Forms of ShowDialog
  82. ----- HyperTalk script -----
  83. on mouseUp
  84.   if the visible of bg fld (the number of me) then
  85.     closeall
  86.   else
  87.     put the number of me into displayinfo
  88.     turnOn displayinfo
  89.   end if
  90. end mouseUp
  91.  
  92.  
  93.  
  94. -- part 3 (button)
  95. -- low flags: 00
  96. -- high flags: A004
  97. -- rect: left=17 top=150 right=172 bottom=194
  98. -- title width / last selected line: 0
  99. -- icon id / first selected line: 0 / 0
  100. -- text alignment: 1
  101. -- font id: 0
  102. -- text size: 12
  103. -- style flags: 0
  104. -- line height: 16
  105. -- part name: Show Dialog XCMD uses...
  106. ----- HyperTalk script -----
  107. on mouseUp
  108.   if the visible of bg fld (the number of me) then
  109.     closeall
  110.   else
  111.     put the number of me into displayinfo
  112.     turnOn displayinfo
  113.   end if
  114. end mouseUp
  115.  
  116.  
  117.  
  118. -- part 4 (button)
  119. -- low flags: 00
  120. -- high flags: A004
  121. -- rect: left=17 top=180 right=202 bottom=194
  122. -- title width / last selected line: 0
  123. -- icon id / first selected line: 0 / 0
  124. -- text alignment: 1
  125. -- font id: 0
  126. -- text size: 12
  127. -- style flags: 0
  128. -- line height: 16
  129. -- part name: How to use it?
  130. ----- HyperTalk script -----
  131. on mouseUp
  132.   if the visible of bg fld (the number of me) then
  133.     closeall
  134.   else
  135.     put the number of me into displayinfo
  136.     turnOn displayinfo
  137.   end if
  138. end mouseUp
  139.  
  140.  
  141.  
  142. -- part 7 (button)
  143. -- low flags: 00
  144. -- high flags: 0000
  145. -- rect: left=11 top=4 right=64 bottom=78
  146. -- title width / last selected line: 0
  147. -- icon id / first selected line: 529 / 529
  148. -- text alignment: 1
  149. -- font id: 0
  150. -- text size: 12
  151. -- style flags: 0
  152. -- line height: 16
  153. -- part name: SD
  154.  
  155.  
  156. -- part contents for background part 21
  157. ----- text -----
  158. What is ShowDialog XCMD? 
  159.  
  160. -- part contents for background part 17
  161. ----- text -----
  162. ShowDialog XCMD takes seven forms: Type 1, Type 2, Type 3, Type 4, Type 5, Type 6, and Type 7.
  163.  
  164. Type 1 allows for "regular" buttons, icons, PICTs, and static text only.  You can modify the text as you wish in the parameter list.
  165.  
  166. Type 2 can have these and ALSO any number of editable text fields that the user can type into and an unlimited number of check boxes.  One of these fields can also contain default text (provided in the parameters).  
  167.  
  168. Type 3 shares the same attributes as Type 2 with the exception that you can have as many radio buttons as you want instead of the check boxes.
  169.  
  170. Type 4 is also similar to Type 2 with the exception that this type contains a popup menu.
  171.  
  172. Types 5 and 6 are used to display "help" screens consisting of multiple PICTs.
  173.  
  174. Type 7 displays a scrolling field from which the user can select lines in a fashion similar to the Font/DA Mover.  You specify the font, pt. size, and default line of the list in the parameter list.  This type can also respond to any number of "regular" buttons.
  175.  
  176.  
  177.  
  178. -- part contents for background part 15
  179. ----- text -----
  180. One of problems with creating professional stacks in HyperCard is that HyperCard's implementation of dialog boxes (the "ask" and "answer" boxes) are too restrictive (too small) as well as being less than glamorous (no icon).  One way around this is to fudge a dialog box with HyperTalk, but  this is a kluge, at best (you can't have a default button).
  181.  
  182. ShowDialog XCMD is an external command that will allow you to display ANY type of dialog or alert that can contain ANY number of buttons, ANY amount of text, and ANY number of icons or PICT resources.  You decide  whether the  dialog or alert is to have  a default (outlined) button.  You can have as many fields of static text as you wish and can modify any two of these on the fly (in the XCMD parameter list).
  183.  
  184. You can have any number of editable text fields that the user can type into.  One of these fields can contain a default text string (that you specify in the parameter list).  Your dialog can have as many check boxes or radio buttons as you want or can have a popup menu or a scrolling list from which the user can select items.
  185.  
  186. You can also create specialized dialogs for the display of interactive help screens, color icon bars, or Macintosh "splash screens."
  187.  
  188. You use ResEdit to create the necessary DLOG/DITL resources that allow ShowDialog to function.
  189.  
  190.  
  191.  
  192. -- part contents for background part 31
  193. ----- text -----
  194. ShowDialog XCMD uses DLOG/DITL resource 
  195. "templates" for the display of dialogs and alerts.  You create these resources using ResEdit, thus allowing you to create dialogs that are EXACTLY tailored to YOUR needs.
  196.  
  197. If you wish, you can put the XCMD and associated 
  198. DLOG/DITL templates in your Home stack, and have your customized dialogs and alerts accessible from all your stacks.
  199.  
  200. The DLOG/DITL template can contain:
  201.  
  202. ΓÇó icons
  203. Use the icons that are imbedded in HyperCard or create and import your own with ResEdit.
  204.  
  205. ΓÇó PICTs
  206. These comprise the graphic artwork that you have in your dialog.  They can be created in any paint or draw program and imported into a stack with ResEdit.  Or you can create PICTs from within this stack using PICT Maker.  Dialogs can display color PICTs.  These must be created with a color paint or draw application.
  207.  
  208. ΓÇó text
  209. Dialogs can contain static text (that cannot be modified by the user) and editable text fields.
  210.  
  211. ΓÇó buttons
  212. Depending on the "type" of ShowDialog, your dialog       can contain:
  213.                 "regular" buttons
  214.                   radio buttons
  215.                   check boxes
  216.                 "hot spot" buttons
  217.  
  218. ΓÇó Popup Menu
  219. Type 4 of ShowDialog can contain a popup menu.  You can specify the style attributes of each individual menu item and disable them if you wish.  The elements of the popup menu are created from "user item" type DITL items.
  220.  
  221.  
  222.  
  223. -- part contents for background part 30
  224. ----- text -----
  225. 12
  226.  
  227. -- part contents for background part 18
  228. ----- text -----
  229. In its most basic form, use ShowDialog to replace HyperCard's standard "ask" and "answer" boxes with dialogs that adhere to the Macintosh standard.  These dialogs can contain icons, PICTs, and multiple fields of text.
  230.  
  231. In its more elaborate forms, ShowDialog allows you to extend the vocabulary of HyperTalk by providing a method for the display of some exceedingly complex dialogs.  These dialogs can contain other forms of control structures (radio buttons, check boxes, and popup menus), and offer very sophisticated handling of graphics.
  232.  
  233. ShowDialog dialogs support color icons (cicn's) and PICTs.